<template>
	<view class="zdTabBar">
		<view class="ul">
			<view :class="['li',current == index?'cur' :'']" v-for="(item,index) in taBbarList" :key="index" :data-index="index"  @tap="navigatorTo(item.url,item.type)">
				<view class="img" v-if="item.type == 0">
					<image :src="current == index ? item.selectIcon : item.icon" mode="widthFix"></image>
				</view>
				<view class="ic" v-if="item.type == 1">+</view>
				<view class="p">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			current: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				taBbarList: [{
						type: 0,
						icon: '/static/home.png',
						selectIcon: '/static/homeselect.png',
						name: '单据功能',
						url: '/pages/index/index'
					},
					{
						type: 0,
						icon: '/static/good.png',
						selectIcon: '/static/goodselect.png',
						name: '报表查询',
						url: '/pages/orderList/orderList?type=1'
					},
					{
						type: 1,
						icon: '/static/logo.png',
						selectIcon: '/static/logo_cur.png',
						url: '/pages/Diy/Diy'
					},
					{
						type: 0,
						icon: '/static/mx.png',
						selectIcon: '/static/mxselect.png',
						name: '档案中心',
						url: '/pages/orderList/orderList?type=0'
					},
					{
						type: 0,
						icon: '/static/my.png',
						selectIcon: '/static/myselect.png',
						name: '设置',
						url: '/pages/my/my'
					}
				]
			}
		},
		methods: {
			navigatorTo(e,type) {
				if(type==1){
					uni.redirectTo({
						url: e,
					});
				}else{
					uni.redirectTo({
						url: e,
					});
				}
				
			}
		}
	}
</script>
